import { getSmsSendLogList } from '../../../../api/sms'
import { ref } from "vue";
import { GetSmsSendLogListParam, SendLogListItem } from "../types";

// 获取记录列表加载
const getSmsSendLogListLoading = ref(false)

// 发送记录列表
const smsSendList = ref<Array<SendLogListItem>>([])

// 列表总数量
const totalList = ref(0)

// 获取记录列表方法
const getSmsSendLogListFn = async (param: GetSmsSendLogListParam) => {
    getSmsSendLogListLoading.value = true
    const res = await getSmsSendLogList(param)
    getSmsSendLogListLoading.value = false
    smsSendList.value = res.data.data.rows
    totalList.value = res.data.data.total
}

export default {
    totalList,
    smsSendList,
    getSmsSendLogListLoading,
    getSmsSendLogListFn
}